package com.zsl.swing.redis.desktop.utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class TextFileReadUtils {

    public static List<String>  readLineList(String filename){
        File file = new File(filename);

        if(!file.exists()){
            return Collections.emptyList();
        }

        try(
                BufferedReader reader = new BufferedReader(new FileReader(file));
        ){

            return reader.lines().collect(Collectors.toList());
        }catch (Exception e){
            e.printStackTrace();
            return Collections.emptyList();
        }
    }


}
